var oneChanneli = document.getElementById("oneChannelValue").value;
var twoChanneli = document.getElementById("twoChannelValue").value;
var thrChanneli = document.getElementById("thrChannelValue").value;
var oneMediumi = document.getElementById("oneMediumValue").value;
var twoMediumi = document.getElementById("twoMediumValue").value;
var thrMediumi = document.getElementById("thrMediumValue").value;
$.post(Feng.ctxPath + "/medium/getMedium", function (data) {
    MediumList = data;
    mediumInit('oneMedium', 'twoMedium', 'thrMedium');
}, "json");
$(".showBox").click(function () {
    $(this).hide();
    $("#isRevisitInfoForm .hideBox").show();
    $("#isRevisitInfoForm").css('box-shadow', '0 0 5px #666666');
});
$(".cancel").click(function () {
    $('.showBox').show();
    $("#isRevisitInfoForm .hideBox").hide();
    $("#isRevisitInfoForm").css('box-shadow', '0 0 0 white');
});
$("#oneChannel").change(function () {
    oneChanneli = $('#oneChannel').val();
    $.post(Feng.ctxPath + "/channel/getChannelssd", function (data) {
        ChannelList = data;
        channelInit('oneChannel', 'twoChannel', 'thrChannel');
        oneChanneli = $('#oneChannel').val();
        twoChanneli = $('#twoChannel').val();
        thrChanneli = $('#thrChannel').val();
        oneMediumi = $('#oneChannel').val();
        twoMediumi = $('#twoChannel').val();
        thrMediumi = $('#thrChannel').val();
        MediumList = "${getMedium}";
        mediumInit('oneMedium', 'twoMedium', 'thrMedium');
    }, "json");
});
$("#twoChannel").change(function () {
    twoMediumi = $('#twoChannel').val();
    twoChanneli = $('#twoChannel').val();
    MediumList = "${getMedium}";
    mediumInit('oneMedium', 'twoMedium', 'thrMedium');
    thrMediumi = $('#thrChannel').val();
    thrChanneli = $('#thrChannel').val();
    MediumList = "${getMedium}";
    mediumInit('oneMedium', 'twoMedium', 'thrMedium');
});
$("#thrChannel").change(function () {
    thrMediumi = $('#thrChannel').val();
    thrChanneli = $('#thrChannel').val();
    MediumList = "${getMedium}";
    mediumInit('oneMedium', 'twoMedium', 'thrMedium');
});
var phoneSharShipValue = $('#phoneSharShipValue').val();
if (phoneSharShipValue != "") {
    $("#phoneSharShip option[value='" + phoneSharShipValue + "']").attr("selected", "selected");
}
checkDate = function () {
    if (new Date($("#appointmentTime").val()) < new Date()) {
        alert("下次跟进时间不能小于当前时间！");
        $("#appointmentTime").val("")
    }
};

function effective() {
    if ($("#follower").val() != "" && $("#follower").val() != null
        && $("#follower").val() != undefined && $("#follower").val() != "待定") {
        $("#aaa").hide();
        document.getElementById("isEffective").value = 1;
    } else {
        $("#aaa").show();
        document.getElementById("isEffective").value = 1;
    }
};

function noEffective() {
    $("#aaa").hide();
    document.getElementById("followers").value = document.getElementById("follower").value;
    document.getElementById("isEffective").value = 2;
};

$("#statuss").change(function () {
    if ($("#statuss option:selected").text() == "过期") {
        $("#appointmentTime").val(setDateTime(new Date(), 0))
    } else if ($("#statuss option:selected").text() == "无效") {
        $("#appointmentTime").val("")
    }
});